package com.haircut.project.vo.record.excel;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haircut.project.constant.RecordConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Setter
@Getter
public class RecordResExcelVo {

    /**
     * id
     */
    @ExcelProperty("订单号")
    @ColumnWidth(20)
    private String id;
    @ExcelProperty("创建时间")
    @ColumnWidth(20)
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "America/Los_Angeles")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    @ExcelProperty("流水号")
    @ColumnWidth(20)
    private String cardRemark;
    @ExcelProperty("技师名称")
    @ColumnWidth(20)
    private String createUserName;
    @ExcelProperty("状态")
    @ColumnWidth(20)
    private String recordTypeStr;
    @ExcelProperty("项目金额")
    @ColumnWidth(20)
    private BigDecimal totalAmount;
    @ExcelProperty("分成比例(%)")
    @ColumnWidth(20)
    private BigDecimal technicianRate;
    @ExcelProperty("优惠金额")
    @ColumnWidth(20)
    private BigDecimal discountAmount;
    @ExcelProperty("收费现金")
    @ColumnWidth(20)
    private BigDecimal totalCashAmount;
    @ExcelProperty("收费电子")
    @ColumnWidth(20)
    private BigDecimal totalCardAmount;
    @ExcelProperty("技师现金")
    @ColumnWidth(20)
    private BigDecimal techCashAmount;
    @ExcelProperty("技师电子")
    @ColumnWidth(20)
    private BigDecimal techCardAmount;
    @ExcelProperty("技师小费")
    @ColumnWidth(20)
    private BigDecimal tipsCardAmount;
    @ExcelProperty("公司现金")
    @ColumnWidth(20)
    private BigDecimal companyCashAmount;
    @ExcelProperty("公司电子")
    @ColumnWidth(20)
    private BigDecimal companyCardAmount;
    @ExcelProperty("公司总金额")
    @ColumnWidth(20)
    private BigDecimal companyTotalAmount;
    @ExcelProperty("备注")
    @ColumnWidth(20)
    private String recordRemark;

    public void formt(Integer state){
        if(ObjectUtil.equal(state, RecordConstant.RecordType.NEW_RECORD)){
            this.recordTypeStr ="待核查";
        }else  if(ObjectUtil.equal(state, RecordConstant.RecordType.CHECK_RECORD)){
            this.recordTypeStr ="待发工资";
        }else{
            this.recordTypeStr ="已发工资";
        }
    }
}
